[jquery] Different function for same class on 'click' / 'dblclick'
Posted
by Shishant
on Stack Overflow
See other posts from Stack Overflow
or by Shishant
Published on 2010-03-28T13:04:13Z
Indexed on
2010/03/28
13:13 UTC
Read the original article
Hit count: 95
jQuery
|JavaScript
Hello,
This are my two functions, on single click it works fine, but on dblclick both functions execute, any idea? I tried using live
instead of delegate
but still both functions execute on dblclick
// Change Status on click
$(".todoBox").delegate("li", "click", function() {
var id = $(this).attr("id");
$.ajax({
//ajax stuff
});
return false;
});
// Double Click to Delete
$(".todoBox").delegate("li", "dblclick", function(){
var id = $(this).attr("id");
$.ajax({
//ajax stuff
});
return false;
});
© Stack Overflow or respective owner